//
//  ViewController.m
//  JSCoreDemo
//
//  Created by 李煜 on 2022/1/18.
//

#import "ViewController.h"

#import <UIKit/UIKit.h>

#import <JavaScriptCore/JavaScriptCore.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    JSContext *cxt = [[JSContext alloc]init];
    JSValue *val = [cxt evaluateScript:@"var a = 1; var b = 2; a + b"];
    NSInteger sum = val.toInt32;
    
}


@end
